package o;

import com.huawei.hwid.core.constants.HwAccountConstants;

abstract class gcg {
    f ˎ;

    static class d extends gcg {
        private String ˋ;

        d() {
            super();
            this.ˎ = f.Character;
        }

        gcg ˊ() {
            this.ˋ = null;
            return this;
        }

        d ˊ(String str) {
            this.ˋ = str;
            return this;
        }

        String ॱˊ() {
            return this.ˋ;
        }

        public String toString() {
            return ॱˊ();
        }
    }

    static final class a extends d {
        a(String str) {
            ˊ(str);
        }

        public String toString() {
            return "<![CDATA[" + ॱˊ() + "]]>";
        }
    }

    static final class b extends gcg {
        final StringBuilder ˋ;
        boolean ˏ;

        gcg ˊ() {
            gcg.ˏ(this.ˋ);
            this.ˏ = false;
            return this;
        }

        b() {
            super();
            this.ˋ = new StringBuilder();
            this.ˏ = false;
            this.ˎ = f.Comment;
        }

        String ॱˊ() {
            return this.ˋ.toString();
        }

        public String toString() {
            return "<!--" + ॱˊ() + "-->";
        }
    }

    static final class c extends gcg {
        final StringBuilder ˊ;
        final StringBuilder ˋ;
        String ˏ;
        final StringBuilder ॱ;
        boolean ᐝ;

        c() {
            super();
            this.ˋ = new StringBuilder();
            this.ˏ = null;
            this.ॱ = new StringBuilder();
            this.ˊ = new StringBuilder();
            this.ᐝ = false;
            this.ˎ = f.Doctype;
        }

        gcg ˊ() {
            gcg.ˏ(this.ˋ);
            this.ˏ = null;
            gcg.ˏ(this.ॱ);
            gcg.ˏ(this.ˊ);
            this.ᐝ = false;
            return this;
        }

        String ॱˊ() {
            return this.ˋ.toString();
        }

        String ॱᐝ() {
            return this.ˏ;
        }

        String ॱˎ() {
            return this.ॱ.toString();
        }

        public String ॱˋ() {
            return this.ˊ.toString();
        }

        public boolean ʻॱ() {
            return this.ᐝ;
        }
    }

    static final class e extends gcg {
        e() {
            super();
            this.ˎ = f.EOF;
        }

        gcg ˊ() {
            return this;
        }
    }

    public enum f {
        Doctype,
        StartTag,
        EndTag,
        Comment,
        Character,
        EOF
    }

    static abstract class j extends gcg {
        private String ʻ;
        private String ʼ;
        private boolean ʽ = false;
        protected String ˊ;
        protected String ˋ;
        gbi ˏ;
        boolean ॱ = false;
        private boolean ॱॱ = false;
        private StringBuilder ᐝ = new StringBuilder();

        j() {
            super();
        }

        /* synthetic */ gcg ˊ() {
            return ॱˊ();
        }

        j ॱˊ() {
            this.ˊ = null;
            this.ˋ = null;
            this.ʻ = null;
            gcg.ˏ(this.ᐝ);
            this.ʼ = null;
            this.ʽ = false;
            this.ॱॱ = false;
            this.ॱ = false;
            this.ˏ = null;
            return this;
        }

        final void ॱᐝ() {
            if (this.ˏ == null) {
                this.ˏ = new gbi();
            }
            if (this.ʻ != null) {
                this.ʻ = this.ʻ.trim();
                if (this.ʻ.length() > 0) {
                    String stringBuilder = this.ॱॱ ? this.ᐝ.length() > 0 ? this.ᐝ.toString() : this.ʼ : this.ʽ ? "" : null;
                    this.ˏ.ˏ(this.ʻ, stringBuilder);
                }
            }
            this.ʻ = null;
            this.ʽ = false;
            this.ॱॱ = false;
            gcg.ˏ(this.ᐝ);
            this.ʼ = null;
        }

        final void ʻॱ() {
            if (this.ʻ != null) {
                ॱᐝ();
            }
        }

        final String ॱˎ() {
            boolean z = this.ˊ == null || this.ˊ.length() == 0;
            gbj.ॱ(z);
            return this.ˊ;
        }

        final String ॱˋ() {
            return this.ˋ;
        }

        final j ˊ(String str) {
            this.ˊ = str;
            this.ˋ = gbg.ˎ(str);
            return this;
        }

        final boolean ᐝॱ() {
            return this.ॱ;
        }

        final gbi ʽॱ() {
            return this.ˏ;
        }

        final void ˎ(String str) {
            if (this.ˊ != null) {
                str = this.ˊ.concat(str);
            }
            this.ˊ = str;
            this.ˋ = gbg.ˎ(this.ˊ);
        }

        final void ˎ(char c) {
            ˎ(String.valueOf(c));
        }

        final void ॱ(String str) {
            if (this.ʻ != null) {
                str = this.ʻ.concat(str);
            }
            this.ʻ = str;
        }

        final void ˊ(char c) {
            ॱ(String.valueOf(c));
        }

        final void ˋ(String str) {
            ʾ();
            if (this.ᐝ.length() == 0) {
                this.ʼ = str;
            } else {
                this.ᐝ.append(str);
            }
        }

        final void ˏ(char c) {
            ʾ();
            this.ᐝ.append(c);
        }

        final void ॱ(int[] iArr) {
            ʾ();
            for (int appendCodePoint : iArr) {
                this.ᐝ.appendCodePoint(appendCodePoint);
            }
        }

        final void ˈ() {
            this.ʽ = true;
        }

        private void ʾ() {
            this.ॱॱ = true;
            if (this.ʼ != null) {
                this.ᐝ.append(this.ʼ);
                this.ʼ = null;
            }
        }
    }

    static final class g extends j {
        g() {
            this.ˎ = f.EndTag;
        }

        public String toString() {
            return "</" + ॱˎ() + ">";
        }
    }

    static final class i extends j {
        /* synthetic */ gcg ˊ() {
            return ॱˊ();
        }

        i() {
            this.ˏ = new gbi();
            this.ˎ = f.StartTag;
        }

        j ॱˊ() {
            super.ॱˊ();
            this.ˏ = new gbi();
            return this;
        }

        i ˋ(String str, gbi o_gbi) {
            this.ˊ = str;
            this.ˏ = o_gbi;
            this.ˋ = gbg.ˎ(this.ˊ);
            return this;
        }

        public String toString() {
            if (this.ˏ == null || this.ˏ.ॱ() <= 0) {
                return "<" + ॱˎ() + ">";
            }
            return "<" + ॱˎ() + HwAccountConstants.BLANK + this.ˏ.toString() + ">";
        }
    }

    abstract gcg ˊ();

    private gcg() {
    }

    String ˎ() {
        return getClass().getSimpleName();
    }

    static void ˏ(StringBuilder stringBuilder) {
        if (stringBuilder != null) {
            stringBuilder.delete(0, stringBuilder.length());
        }
    }

    final boolean ˏ() {
        return this.ˎ == f.Doctype;
    }

    final c ˋ() {
        return (c) this;
    }

    final boolean ॱ() {
        return this.ˎ == f.StartTag;
    }

    final i ʼ() {
        return (i) this;
    }

    final boolean ᐝ() {
        return this.ˎ == f.EndTag;
    }

    final g ॱॱ() {
        return (g) this;
    }

    final boolean ʻ() {
        return this.ˎ == f.Comment;
    }

    final b ʽ() {
        return (b) this;
    }

    final boolean ˋॱ() {
        return this.ˎ == f.Character;
    }

    final boolean ˊॱ() {
        return this instanceof a;
    }

    final d ˏॱ() {
        return (d) this;
    }

    final boolean ͺ() {
        return this.ˎ == f.EOF;
    }
}
